package us.nchu.tomtiger.rowMapper;

import org.springframework.jdbc.core.RowMapper;
import us.nchu.tomtiger.model.UserPending;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by XiongXuan on 2018/1/11.
 */
public class UserPendingRowMapper implements RowMapper<UserPending> {

    @Override
    public UserPending mapRow(ResultSet resultSet, int i) throws SQLException {
        UserPending userPending = new UserPending();

        userPending.setId(resultSet.getInt("id"));
        userPending.setChangedUserType(resultSet.getInt("changed_user_type"));
        userPending.setPhoneNumber(resultSet.getString("phone_number"));
        userPending.setResult(resultSet.getInt("result"));

        return userPending;
    }
}
